import java.io.*;
import java.util.HashMap;

public class 四平方和_哈希 {
        static HashMap<Integer,Node> hashMap = new HashMap<>();
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintStream out = new PrintStream(System.out);
        int n = Integer.parseInt(in.readLine());
        //1.字典序存下c,d
        for (int c = 0; c * c <= n; c++)
            for (int d = c; c * c + d * d <= n; d++) {
                int t = c * c + d * d;
                if(!hashMap.containsKey(t)) hashMap.put(t,new Node(c,d));
            }

        //2.遍历a,b
        for (int a = 0; a * a <= n; a++)
            for (int b = a; b * b + a * a <= n; b++) {
                int t = n - a * a - b * b;
                if(hashMap.containsKey(t)){
                    int c = hashMap.get(t).c;
                    int d = hashMap.get(t).d;
                    System.out.println(a+" "+b+" "+c+" "+d);
                    return;
                }
            }
    }
}
class Node {
    int c =0;
    int d=0;
    public Node(int c, int d) {
            this.c = c;
            this.d = d;
    }
}
